﻿#include "hash.h"

//struct keof
//{
//	int operator()(int x)
//	{
//		return x;
//	}
//};

void test1()
{
	openadders::hash_table<int> h1(11);
	int arr[] = { 19, 30, 5, 36, 13, 20, 21, 12 };


	for (auto& x : arr)
	{
		h1.insert(x);
	}
	cout << h1.erase(21) << endl;
	cout << h1.find(21) << endl;
}



void test2()
{
	hash_bucket::HashTable<int, int> h1;
	int arr[] = { 19, 30, 5, 36, 13, 20, 21, 12 };


	for (auto& x : arr)
	{
		h1.insert({x,x});
	}
	//cout << h1.insert({ 19,19 }) << endl;
	//cout << h1.erase(30) << endl;
	cout << h1.find(20) << endl;
}
void test3()
{
	hash_bucket::HashTable<string ,string> dict;
	dict.insert({ "sort", "排序" });
	dict.insert({ "srot", "?" });

	dict.insert({ "string", "字符串" });
	cout << dict.erase("saf") << endl;
	cout << dict.erase("srot") << endl;

	cout << dict.find("string") << endl;

}
int main()
{
	//test1();
	//test2();
	test3();
	return 0;
}